<template>
  <div>
  <span>选择培训班级->选择培训计划->选择培训员工->选择需要录入成绩的培训课程</span>
  <el-cascader-panel :options="options" filterable placeholder="搜索" v-model="getNodesValue"></el-cascader-panel>
  <el-button type="success" @click="nodesValueArr">确认</el-button>
    <el-dialog :visible.sync= "isShowAddInputGrade">
      <span>请录入{{getNodesValue[0]}}->{{getNodesValue[1]}}->{{getNodesValue[2]}}->{{getNodesValue[3]}}的成绩</span>
      <el-input v-model="grade" placeholder="请输入成绩"></el-input>
      <el-button type="primary" @click="inputGrade">录入</el-button>
    </el-dialog>
  </div>
</template>

<script>
    export default {
        name: "EmpTrainGradeInput",
      data() {
        return {
          //级联选择器结果数组
          getNodesValue: [],
          //这一课的成绩
          grade:'',
          //是否显示弹窗
          isShowAddInputGrade:false,
          options: [{
            value: '班级编号',
            label: '培训A班',
            children: [{
              value: '计划编号A',
              label: '计划A',
              children: [{
                value: '学员编号-张三',
                label: '张三',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-李四',
                label: '李四',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-王五',
                label: '王五',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-狗六',
                label: '狗六',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }]
            },{value:"计划编号-计划B",
               label: "计划B",
              children: [{
                value: '计划编号A',
                label: '计划A',
                children: [{
                  value: '学员编号-张三',
                  label: '张三',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-李四',
                  label: '李四',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-王五',
                  label: '王五',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-狗六',
                  label: '狗六',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }]
              }]
            }]
          },{
            value: '班级编号',
            label: '培训A班',
            children: [{
              value: '计划编号A',
              label: '计划A',
              children: [{
                value: '学员编号-张三',
                label: '张三',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-李四',
                label: '李四',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-王五',
                label: '王五',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }, {
                value: '学员编号-狗六',
                label: '狗六',
                children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
              }]
            },{value:"计划编号-计划B",
              label: "计划B",
              children: [{
                value: '计划编号A',
                label: '计划A',
                children: [{
                  value: '学员编号-张三',
                  label: '张三',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-李四',
                  label: '李四',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-王五',
                  label: '王五',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }, {
                  value: '学员编号-狗六',
                  label: '狗六',
                  children:[{value:"科目编号-科目1",label:"科目1"},{value:"科目编号-科目2",label:"科目2"}]
                }]
              }]
            }]
          }
          ]
        }
      },
      methods:{
          //确认按钮
        nodesValueArr(){
          if(this.getNodesValue[3]!=null){
            this.isShowAddInputGrade=true;
          }else{
            this.$message("未完成全部选择");
          }
          console.log("AAAAA",this.getNodesValue);
        },
        //录入按钮
        inputGrade(){
          console.log("BBBBB",this.grade);
        }
      }
    }
</script>

<style scoped>

</style>
